package com.uyayo.ucenter.service;

import com.uyayo.framework.common.exception.CodeMultipleException;
import com.uyayo.framework.common.exception.ParentNotFoundException;
import com.uyayo.framework.core.service.IBaseService;
import com.uyayo.ucenter.entity.Resource;
import com.uyayo.ucenter.model.ResourceCondition;

import java.util.List;

public interface ResourceService extends IBaseService<Resource> {
	
	List<Resource> selectResource(ResourceCondition resourceCondition) throws Exception;

	List<Resource> resourceTreeGrid(Resource resource);

	List<Resource> selectResourceAll(Resource resource);

	/**
	 * 根据上级Id获取记录数
	 * @param parentId 上级id
	 * @return int
	 */
	int selectCountByParentId(Long parentId);

	int saveResource(Resource resource) throws CodeMultipleException, ParentNotFoundException;

	int updateResource(Resource resource) throws ParentNotFoundException, CodeMultipleException;

	int deleteResource(Long id);
}
